//
//  PatientSchemeEntity.m
//  WCN
//
//  Created by 杨鑫 on 15/7/2.
//  Copyright (c) 2015年 ShanghaiCize Trade And Business Co., Ltd. All rights reserved.
//

#import "PatientSchemeEntity.h"
//
#import "PatientScheme.h"
//
#import "NSDate+Utilities.h"

@implementation PatientSchemeEntity

- (instancetype)initWithPatientScheme:(PatientScheme *)scheme
{
    self = [super init];
    if (self) {
        _stringId = scheme.stringId;
        _recordId = scheme.recordId;
        _bodyPartCode = scheme.bodyPartCode;
        _bodyPartName = scheme.bodyPartName;
        _templateCaseId = scheme.templateCaseId;
        _templateCaseName = scheme.templateCaseName;
        
        _startDate = scheme.startDate;
        _status = scheme.status;
        
        NSDate *currentDate = [NSDate date];
        NSDate *oldDate = [NSDate dateWithString:scheme.startDate byFormat:@"yyyy-MM-dd"];
        _startDay = scheme.startDay + (int)[currentDate daysAfterDate:oldDate];
    }
    return self;
}

@end
